/**
 * 
 */
package edu.towson.cosc603.coffeemaker;

import static org.junit.Assert.*;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * @author Poornima
 *
 */
public class RecipeTest extends TestCase{

	private Recipe recipeCoffee;
	private Recipe recipeLatte;
	private Recipe recipeMocha;
	private Recipe recipeFrappuccino;
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		
		recipeCoffee = new Recipe();
		recipeCoffee.setName("Coffee");
		recipeCoffee.setPrice(70);
		recipeCoffee.setAmtCoffee(6);
		recipeCoffee.setAmtMilk(1);
		recipeCoffee.setAmtSugar(1);
		recipeCoffee.setAmtChocolate(0);

		recipeLatte = new Recipe();
		recipeLatte.setName("Latte");
		recipeLatte.setPrice(50);
		recipeLatte.setAmtCoffee(5);
		recipeLatte.setAmtMilk(2);
		recipeLatte.setAmtSugar(1);
		recipeLatte.setAmtChocolate(0);

		recipeMocha = new Recipe();
		recipeMocha.setName("Mocha");
		recipeMocha.setPrice(50);
		recipeMocha.setAmtCoffee(6);
		recipeMocha.setAmtMilk(1);
		recipeMocha.setAmtSugar(1);
		recipeMocha.setAmtChocolate(6);
		
		recipeFrappuccino = new Recipe();
		recipeFrappuccino.setName("Frappuccino");
		recipeFrappuccino.setPrice(50);
		recipeFrappuccino.setAmtCoffee(6);
		recipeFrappuccino.setAmtMilk(6);
		recipeFrappuccino.setAmtSugar(6);
		recipeFrappuccino.setAmtChocolate(0);
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#getAmtChocolate()}.
	 * Post Condition: Test will be true if the amount of Chocolate matches with the recipe's chocolate amount.
	 */
	@Test
	public void testGetAmtChocolate() {
		assertEquals(6, recipeMocha.getAmtChocolate());
		
	}


	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#getAmtCoffee()}.
	 * Post Condition: Test will be true if the amount of coffee matches with the recipe's coffee amount.
	 */
	@Test
	public void testGetAmtCoffee() {
		assertEquals(6, recipeFrappuccino.getAmtCoffee());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#getAmtMilk()}.
	 * Post Condition: Test will be true if the  amount of milk matches with the recipe's milk quantity.
	 */
	@Test
	public void testGetAmtMilk() {
		assertEquals(6, recipeFrappuccino.getAmtMilk());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#getAmtSugar()}.
	 * Post Condition: Test will be true if the  amount of sugar matches with the recipe's sugar quantity.
	 */
	@Test
	public void testGetAmtSugar() {
		assertEquals(6, recipeFrappuccino.getAmtSugar());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtChocolate(int amtChocolate)}.
	 * Post Condition: Test will be true if the amount of chocolate would be zero, if we are trying to add less than zero
	 */
	@Test
	public void testSetAmtChocolate() {
	    
	    recipeFrappuccino.setAmtChocolate(0);
		assertEquals(0, recipeFrappuccino.getAmtChocolate());
	}
	
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#equals()}.
	 */
	@Test
	public void testequals() {
	
	    Recipe nullRecipe = new Recipe();
	    nullRecipe.setName(null);
	    assertFalse(nullRecipe.equals(recipeFrappuccino));
	    
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#equals()}.
	 */
	@Test
	public void testequals2() {
	
	     
	    assertTrue(recipeFrappuccino.equals(recipeFrappuccino));
	    
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtSugar()}.
	 */
	@Test
	public void testsetAmtSugar() {
	    recipeFrappuccino.setAmtSugar(-10);
	    assertEquals(0,recipeFrappuccino.getAmtSugar());
	    
	}
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtSugar()}.
	 */
	@Test
	public void testsetAmtSugar2() {
	    recipeFrappuccino.setAmtSugar(26);
	    assertEquals(26,recipeFrappuccino.getAmtSugar());
	    
	}
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtSugar()}.
	 */
	@Test
	public void testsetAmtSugar3() {
	    recipeFrappuccino.setAmtSugar(0);
	    assertEquals(0,recipeFrappuccino.getAmtSugar());
	}
	
	
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#getName()}.
	 * Post Condition: Test will be true if the name matches with the recipe name
	 */
	@Test
	public void testGetName() {
		assertEquals("Frappuccino", recipeFrappuccino.getName());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#getPrice()}.
	 * Post Condition: Test will be true if the price matches with the recipe's price
	 * 
	 */
	@Test
	public void testGetPrice() {
		assertEquals(50, recipeFrappuccino.getPrice());
	}


	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setPrice()}.
	 * Post Condition: Test will be true if the price matches with the recipe's price
	 * 
	 */
	@Test
	public void testSetPrice() {
	    recipeFrappuccino.setPrice(-15);
		assertEquals(0, recipeFrappuccino.getPrice());
	}


	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setPrice()}.
	 * Post Condition: Test will be true if the price matches with the recipe's price
	 * 
	 */
	@Test
	public void testSetPrice2() {
	    recipeFrappuccino.setPrice(0);
		assertEquals(0, recipeFrappuccino.getPrice());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setPrice()}.
	 * Post Condition: Test will be true if the price matches with the recipe's price
	 * 
	 */
	@Test
	public void testSetPrice3() {
	    recipeFrappuccino.setPrice(55);
		assertEquals(55, recipeFrappuccino.getPrice());
	}
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#toString()}.
	 */
	@Test
	public void testToString() {
		
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtChocolate(int amtChocolate)}.
	 */
	@Test
	public void testsetAmtChocolate() {
		recipeFrappuccino.setAmtChocolate(0);
		assertEquals(0,recipeFrappuccino.getAmtChocolate());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtChocolate(int amtChocolate)}.
	 */
	@Test
	public void testsetAmtChocolate2() {
		recipeFrappuccino.setAmtChocolate(-10);
		assertEquals(0,recipeFrappuccino.getAmtChocolate());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtChocolate(int amtChocolate)}.
	 */
	@Test
	public void testsetAmtChocolate3() {
		recipeFrappuccino.setAmtChocolate(10);
		assertEquals(10,recipeFrappuccino.getAmtChocolate());
	}
	
	
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtCoffee(int amtChocolate)}.
	 */
	@Test
	public void testsetAmtCoffee() {
		recipeFrappuccino.setAmtCoffee(10);
		assertEquals(10,recipeFrappuccino.getAmtCoffee());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtCoffee(int amtChocolate)}.
	 */
	@Test
	public void testsetAmtCoffee1() {
		recipeFrappuccino.setAmtCoffee(-10);
		assertEquals(0,recipeFrappuccino.getAmtCoffee());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtCoffee(int amtChocolate)}.
	 */
	@Test
	public void testsetAmtCoffee2() {
		recipeFrappuccino.setAmtCoffee(0);
		assertEquals(0,recipeFrappuccino.getAmtCoffee());
	}
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtMilk(int amtMilk)}.
	 */
	@Test
	public void testsetAmtMilk() {
		recipeFrappuccino.setAmtMilk(21);
		assertEquals(21,recipeFrappuccino.getAmtMilk());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtMilk(int amtMilk)}.
	 */
	@Test
	public void testsetAmtMilk1() {
		recipeFrappuccino.setAmtMilk(0);
		assertEquals(0,recipeFrappuccino.getAmtMilk());
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Recipe#setAmtMilk(int amtMilk)}.
	 */
	@Test
	public void testsetAmtMilk2() {
		recipeFrappuccino.setAmtMilk(-21);
		assertEquals(0,recipeFrappuccino.getAmtMilk());
	}
	

}
